package sseGameApps.controller.mdkbr.regist;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;

import sseGameApps.model.mdkbr.MdKbrUser;
import sseGameApps.service.mdkbr.MdKbrUserService;

public class IndexController extends Controller {

    private MdKbrUserService service = new MdKbrUserService();

    @Override
    public Navigation run() throws Exception {
        requestScope("userId", asString("userId"));

        MdKbrUser mdKbrUser = service.getMdKbrUser(asString("userId"));

        if(mdKbrUser != null){
            requestScope("playerName", mdKbrUser.getPlayerName());
        }
        return forward("index.jsp");
    }
}
